home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / gdb / vx-share / wait.h < prev    next >
C/C++ Source or Header  |  1992-09-11  |  1KB  |  43 lines

  1. /* wait.h - header file for remote wait call */
  2.  
  3. /*
  4. modification history
  5. --------------------
  6. 01a,05jun90,llk  borrowed.
  7. */
  8.  
  9. /* Define how to access the structure that the wait system call stores.
  10.    On many systems, there is a structure defined for this.
  11.    But on vanilla-ish USG systems there is not.  */
  12.  
  13. #ifndef HAVE_WAIT_STRUCT
  14. #define WAITTYPE int
  15. #define WIFSTOPPED(w) (((w)&0377) == 0177)
  16. #define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
  17. #define WIFEXITED(w) (((w)&0377) == 0)
  18. #define WRETCODE(w) ((w) >> 8)
  19. #define WSTOPSIG(w) ((w) >> 8)
  20. #define WCOREDUMP(w) (((w)&0200) != 0)
  21. #define WTERMSIG(w) ((w) & 0177)
  22. #define WSETEXIT(w, status) ((w) = (status))
  23. #define WSETSTOP(w,sig)  ((w) = (0177 | ((sig) << 8)))
  24. #else
  25. #if FALSE
  26. #ifndef ORIG
  27.  
  28. /* don't include sys/wait.h */
  29.  
  30. #else ORIG
  31. #include <sys/wait.h>
  32. #endif ORIG
  33. #endif FALSE
  34. #define WAITTYPE union wait
  35. #define WRETCODE(w) (w).w_retcode
  36. #define WSTOPSIG(w) (w).w_stopsig
  37. #define WCOREDUMP(w) (w).w_coredump
  38. #define WTERMSIG(w) (w).w_termsig
  39. #define WSETEXIT(w, status) ((w).w_status = (status))
  40. #define WSETSTOP(w,sig)  \
  41.   ((w).w_stopsig = (sig), (w).w_coredump = 0, (w).w_termsig = 0177)
  42. #endif
  43.